<?php defined('SYSPATH') or die('No direct script access.');
 
class Futbol
{
	public static function resizeVideo($markup, $w, $h)
	{
		//$w = $dimensions['width'];
		//$h = $dimensions['height'];
		 
		$patterns = array();
		$replacements = array();
		if( !empty($w) )
		{
			$patterns[] = '/width="([0-9]+)"/';
			$patterns[] = '/width:([0-9]+)/';
			 
			$replacements[] = 'width="'.$w.'"';
			$replacements[] = 'width:'.$w;
		}
		 
		if( !empty($h) )
		{
			$patterns[] = '/height="([0-9]+)"/';
			$patterns[] = '/height:([0-9]+)/';
			 
			$replacements[] = 'height="'.$h.'"';
			$replacements[] = 'height:'.$h;
		}
		 
		return preg_replace($patterns, $replacements, $markup);
	}
}
?>